/**
 * Created by apple on 2017/7/26.
 */

import 'whatwg-fetch';
import 'es6-promise';

export function getData() {
  let result = fetch("/api/products",{
    //fetch默认不发送cookie 如果需要发送cookie,需要指定
    credentials:'include',
    header:{
      'Accept':'application/json,text/plain,*/*'
    }
  });
  console.log(result);
  return result
}


export function getListData(id) {
  const result = fetch("/api/products/"+id,{
    credentials:'include',
    header:{"Accept":'application/json,text/plain,*/*'}
  });
  return result
}
